package com.micmac.main.controller
{
	/*
	
	Author : Roy Raul.
	
	Component : MainCommand.             
	
	Version History         : 0.1 Date Jul-20-2011
	
	Current Version         : 0.1 Date Jul-20-2011
	
	Build Date              : Jul-20-2011
	
	*/
	import com.AppConst;
	import com.micmac.customer.interfaces.ICustomerModule;
	import com.micmac.customer.service.CustomerService;
	import com.micmac.customer.view.CorporationView;
	import com.micmac.customer.view.mediator.CorparationViewMediator;
	import com.micmac.customer.view.mediator.CustomerPageViewMediator;
	import com.micmac.main.view.compenents.LeftPanelViewMediator;
	import com.micmac.main.interfaces.IStartupLocaleService;
	import com.micmac.main.interfaces.IStartupService;
	import com.micmac.main.interfaces.IStartupStylesheet;
	import com.micmac.main.mainmodel.StartupMonitorModel;
	import com.micmac.main.mainmodel.interfaces.IStartupModel;
	import com.micmac.main.mainmodel.service.ConfigService;
	import com.micmac.main.mainmodel.service.LocaleProxy;
	import com.micmac.main.mainmodel.service.StyleSheetService;
	import com.micmac.main.view.compenents.BasePage;
	import com.micmac.main.view.compenents.BasePageMediator;
	import com.micmac.main.view.compenents.LeftPanelView;
	import com.micmac.main.view.compenents.SplashMediator;
	import com.micmac.main.view.compenents.SplashScreen;
	
	import flash.events.Event;
	import flash.profiler.profile;
	
	import org.robotlegs.mvcs.Command;
	
	
	
	public class MainCommand extends Command
	{
		/*public function MainCommand(){
			super();
		}*/
		override public function execute():void{
			mapModel();
		}
		/*---------------------------------------
			For maping the classes
		-------------------------------------*/
		private function mapModel():void{
			
			injector.mapSingletonOf(IStartupModel, StartupMonitorModel);
			
			injector.mapSingletonOf(IStartupService, ConfigService);
			injector.mapSingletonOf(IStartupLocaleService, LocaleProxy);
			injector.mapSingletonOf(IStartupStylesheet, StyleSheetService);
			mediatorMap.mapView(SplashScreen, SplashMediator, SplashScreen);
			mediatorMap.mapView(BasePage, BasePageMediator, BasePage);
			mediatorMap.mapView(LeftPanelView,LeftPanelViewMediator,LeftPanelView);
			dispatch(new Event(AppConst.LOAD_RESOURCE));
			
			//mediatorMap.mapView(CustomerPageView,CustomerPageViewMediator,CustomerPageView);
			/*mediatorMap.mapView(CorporationView,CorparationViewMediator,CorporationView);
			injector.mapSingletonOf(ICustomer,CustomerService);*/
			
		}
		
	}
}